domain.c:
Check iopl when booting additional cpus.
smpboot.c:
Set iopl when booting additional cpus.
ctxt.cpu_ctxt.cs = __KERNEL_CS;
ctxt.cpu_ctxt.eip = start_eip;
ctxt.cpu_ctxt.esp = idle->thread.esp;
- ctxt.cpu_ctxt.eflags = (1<<9) | (1<<2);
+ ctxt.cpu_ctxt.eflags = (1<<9) | (1<<2) | (idle->thread.io_pl<<12);
/* FPU is set up to default initial state. */
memset(ctxt.fpu_ctxt, 0, sizeof(ctxt.fpu_ctxt));
&c->cpu_ctxt,
sizeof(d->thread.user_ctxt));
+ /* Clear IOPL for unprivileged domains. */
+ if (!IS_PRIV(d->domain))
+ d->thread.user_ctxt.eflags &= 0xffffcfff;
+
/*
* This is sufficient! If the descriptor DPL differs from CS RPL then we'll
* #GP. If DS, ES, FS, GS are DPL 0 then they'll be cleared automatically.